#ifndef _BINARY_TREE_H_
#define _BINARY_TREE_H_

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
using namespace std;

typedef struct _treeNode
{
  char value;
  struct _treeNode *lChild;
  struct _treeNode *rChild;
} treeNode;

class BinaryTree
{
 public:
  BinaryTree();
  ~BinaryTree();

 public:
  int32_t build();
  int32_t firstVisitRoot();
  int32_t middleVisitRoot();
  int32_t lastVisitRoot();
  int32_t levelVisit();

 protected:
  int32_t create(treeNode** node);
  int32_t destroyTree(treeNode** node);
  int32_t firstVisitRoot(treeNode* node);
  int32_t middleVisitRoot(treeNode* node);
  int32_t lastVisitRoot(treeNode* node);
 
 private:
  BinaryTree(const BinaryTree &other);
  BinaryTree& operator=(const BinaryTree &other);

 private:
  treeNode *m_root;
};

#endif
